Introduction to Tableau¶



ONS / NISR
2021

What is Tableau?¶

Tableau is a dashboarding tool that makes it incredibly easy to create complex, interactive visualisations in a low-code way.

Tableau can optimise for whatever type of device is being used (computer, phone, tablet) meaning it always looks good.

Tableau can be used to make complex interactive dashboards for nearly any data source.

Tableau can be easily embedded on any webpage, or downloaded into a standalone file offline viewing

Getting Started¶


Importing Data¶


Tableau can connect to many different types of data, either directly as files or via a database on a server.

For Files
  • Launch Tableau
  • Under the connect pane select the file type your planning to work with. Text files includes .CSVs and .TSVs etc.
  • Navigate to the file using the file select dialog and click open.

For Databases
  • Connections to live databases aren't available in Tableau public
  • But connections to Google Drive and Google Sheets are available under To a Server > More...

Creating Visualisations¶

Dimensions and Measures (Pills)¶

Tableau automatically creates dimensions and measures based on the data provided and calls them “pills”. In order to create a visualisation we drag these pills to different shelves.
  1. Dimensions are fields that cannot (or should not) be aggregated. These are coloured blue.
  2. Measures are fields that can be aggregated, measured and used for mathematical operations. These are coloured green.
It is possible to change measures to dimensions and vice-versa if Tableau has incorrectly assigned them.

Creating a Table¶

  1. Rename your sheet Table.
  2. Drag the Language pill to the Rows shelf.
  3. Drag the Shirtsize pill to the Columns shelf.
  4. Drag the tableau_data.csv(Count) measure pill to Text mark.
    This pill is autogenerated by Tableau and can be used to count the number of rows


Aggregation¶




  1. Replace tableau_data.csv(Count) with Income.

  2. What does the table show now?

  3. Change the aggregation of Income so the table shows the average income

More detailed tables¶



Measure Names and Measure Values are dynamic pills generated by Tableau.

Try the following:
  1. Drag Measure Names to a row or column
  2. Drag Measure Values to a marks card.


Doing this will create the new Measure Values card. We can now create tables with more than one measure in them.

Create a new visualisation (Viz)¶

There are three types of tab in Tableau:

  • Sheet Create a single chart or visualisation.
  • Dashboards Combine multiple charts or visualisations into a single page.
  • Stories Combine dashboards into a "story".

In order to create each one use the appropriate button at the bottom of the window.


Creating a chart¶



Try the following:

  1. Create a new sheet called Chart.
  2. Drag the Shirtsize pill to the Columns shelf.
  3. Drag the Income measure pill to Rows shelf.


Dragging additional pills onto shelves will split the data further. Dragging pills onto different mark types will theme the chart by elements in these pills.

Use the Show Me drop-down menu to quickly create other chart types. Notice how the pills rearrange themselves.

Filtering¶

The main way a user can interact with a Tableau document. They allow the user to define exactly what data they are looking at and are completely extensible.

  • Choose one of the two visualisations you’ve already created.
  • Drag a pill into the Filter card above the Marks card.
  • Experiment with how different and multiple filters affect your viz.

Filtering by aggregate measures is possible but tricky. Especially when interacting with other filters.

Tooltips¶

You can customise tooltips by clicking on the the tooltip mark. It is also possible to add extra information into tooltips by dragging pills onto the tooltip mark. Tooltips are incredibly useful for providing extra information and for clarifying exactly what a single mark on your data visualisation means.

Maps¶

Tableau is really useful for creating interactive maps very quickly. In order to create a map all we need is a latitude and longitude in our dataset. Dragging those pills to the column and row shelves and a map will form.

It is also possible to connect directly to shapefiles and other spatial data to create even more complex maps.

Connecting to a shapefile¶

Try the following:

  1. Click on the Data Source tab.
  2. Click on the Add under the connections pane.
  3. Click on Spatial File.
  4. Select the .shp file.

Tableau now has two different files open. In order for tableau to know how to use them together you may need to define how the two connect.

  1. Drag the .shp file from the Files pane into the data table area.
  2. Create a relationship between the two data files by setting the matching fields to Adm2 Pcode and Adm2 Pcode2

Your data sources are now connected

Geography and Latitude / Longitude¶

Going back to a worksheet you'll notice that there are a lot more pills available. These have mostly come from the shapefile's data. For example Adm2 En contains the English name for each second level administration region.

There are two new pills generated by Tableau as a result of connecting the shapefile.

  • Geography: This pill can be used to create filled shapes
  • Latitude/Longitude (Generated): This pill can be used to create point maps

Test

Creating a filled map¶

Try the following:

  1. Create a new sheet called FilledMap.
  2. Drag the Geography to the Marks card.


Tableau with automatically generate the map of the region from the shapefile. Notice that you can't select the subdivisions of the region. This is because we need to tell Tableau that we want this level of detail.

  1. Drag the Adm2 Pcode pill into the Marks card.
  2. Drag the Income pill into the Marks colour.

Creating a point map¶

Try the following:

  1. Create a new sheet called PointMap.
  2. Drag the Geography to the Marks card.
  3. Change the Mark type to Circle


Try adding a pills into the Size and Colour marks.

Can you create a pie chart at each region?

Creating Dashboards¶

Creating a Dashboard¶



Create a new dashboard.

Drag in the sheets you’d like to display from the left hand side.

The size of the dashboard can be changed from left hand side.

Dashboard objects¶

Additional objects can be added like images, text and live web pages.

Horizontal and Vertical layouts allow for more control of how your objects tile.

Linked Filtering¶

Filters that you've applied to your worksheet can be accessed from your dashboard. Using the gray down arrow on your chart or table select filters and then the filter you want to be available.

Filters can be styled, and applied to multiple visualisations on the dashboard by using Apply to Worksheets. You can create very complex behavior using this method.

Dashboard Actions¶



Dashboard actions are like linked filters, but they allow for different behaviors. Instead of interacting with a filter object on the page, interacting with a visualisations causes changes in other visualisations.

Try adding a highlight action between your charts on Shirtsize. What happens if you change the behavior to hover?

Publishing¶

Tableau public is a Tableau Inc.'s instance of Tableau server, available to anyone who wishes to publish there. All published data and workbooks are available to the public.

Data will be uploaded directly to Tableau public's server and be available across the site. It will keep all your calculated fields, parameters, formatting and other metadata you’ve created.

It is viewable through any web browser, can be edited in Tableau and re-uploaded.

Tableau Public is Public! As Tableau needs access to raw data in order to work, if you publish a dashboard with sensitive data, anyone will be able to see it!

Publishing in Tableau Public is as simple as saving (its actually the only way you can save).

How to publish¶

Publishing in Tableau Public is as simple as saving (its actually the only way you can save).

File -> Save to Tableau Public

Once you've signed in you should only need to set the name for your workbook to be published. This will then automatically open your browser to a published tableau workbook. From here you can use the share icon to get a link to send to people and embed code that can be put on any website.

Advanced Topics¶

Calculated Fields¶

Its possible to create entirely new fields in Tableau using calculated fields. Right-click in the tables pane and select Create -> Calculated Field.

These can be very handy, but best practice is to have as many fields on your data source as possible, so they can be verified at an earlier stage.

Table Calculations¶

Table calculations are extremely powerful tools that allow you to create variables that calculate their value by looking at the entire dataset (or a section of it). They are also dynamic, meaning they respond to which ever pills are in the table. This can save you having to calculate every possible percentage in your dataset and instead calculate them on the fly.

Custom Colour-schemes¶

Tableau has a lot of built in colour schemes, but in order to create professionally looking visualisations, its often useful to have a consistent format across the organisation. You can do this manually but it is a bit of a chore, however editing the Preferences.tps in your My Tableau repository.

Find out more¶

Tableau help: https://www.tableau.com/support/help

Forums: https://community.tableau.com/welcome

Training videos: https://www.tableau.com/learn/training

Sample data & how-to videos: https://public.tableau.com/en-us/s/resources

For inspiration: https://public.tableau.com/en-us/s/gallery